package com.umeng.comm.ui.activities;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.qianxx.base.BaseAty;
import com.qianxx.draw.R;
import com.umeng.comm.core.beans.CommUser;
import com.umeng.comm.core.impl.CommunitySDKImpl;
import com.umeng.comm.core.login.LoginListener;
import com.umeng.community.example.Utils.ThirdLoginOutRequestUtils;

/**
 * Created by summersoft on 2016/5/12.
 */
public class SetActivity extends BaseAty {

    @Override
    protected void onCreate(Bundle arg0) {
        super.onCreate(arg0);
        setContentView(R.layout.set);
        showTitle("设置");
        initUI();
    }

    private void initUI() {
        findViewById(R.id.opinion_tv).setOnClickListener(this);
        findViewById(R.id.about_tv).setOnClickListener(this);
        findViewById(R.id.quit_tv).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {
            case R.id.opinion_tv:
                startActivity(new Intent(this, OpinionActivity.class));
                break;
            case R.id.about_tv:
                startActivity(new Intent(this, AboutActivity.class));
                break;
            case R.id.quit_tv:
                showLoading();
                CommunitySDKImpl.getInstance().logout(this, new LoginListener() {
                    @Override
                    public void onStart() {

                    }

                    @Override
                    public void onComplete(int stCode, CommUser userInfo) {
                        ThirdLoginOutRequestUtils.getInstance(SetActivity.this, SetActivity.this).ThirdLoginOut();
                    }
                });

                break;
            default:
                break;
        }
    }
}
